//Vehicle.h
#ifndef VEHICLE_H_
#define VEHICLE_H_
#include <iostream>
using namespace std;
class Vehicle {
protected:
    int wheels;
    double weight;
public:
    Vehicle(int wh = 0, double we = 0) {
        if (wh < 0 || we < 0) {
            cout << "数据输入有误" << endl;
            wheels = 0;
            weight = 0;
        } else {
            wheels = wh;
            weight = we;
        }
    }

    Vehicle(const Vehicle& v) {
        this->wheels = v.wheels;
        this->weight = v.weight;
    }

    virtual ~Vehicle() {}

    virtual void Display() = 0;

    void setWheels(int wheels) {
        this->wheels = wheels;
    }

    int getWheels() {
        return this->wheels;
    }

    void setWeight(double weight) {
        this->weight = weight;
    }

    double getWeight() {
        return this->weight;
    }
};
#endif